package com.fagp.mew.cms.messages;

import lombok.*;

import java.util.List;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageResponse {

    public int code = 0;// 0 成功 1失败

    public long count;//总条数
    public List data;//数据

    public String msg = "操作成功";//新消息

    public PageResponse(boolean success){
        if (!success){
            this.msg = "操作失败";
            this.code = 1;
        }
    }

    public PageResponse(String data){
        this.msg = data;
        this.code = 1;
    }

    public PageResponse(List data){
        this.data = data;
    }

}
